home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / snippet.exe / RMALLWS.C < prev    next >
C/C++ Source or Header  |  1992-04-27  |  541b  |  28 lines

  1. /*
  2. **  Originally published as part of the MicroFirm Function Library
  3. **
  4. **  Copyright 1986, S.E. Margison
  5. **  Copyright 1989, Robert B.Stout
  6. **
  7. **  Subset version released to the public domain, 1991
  8. **
  9. **  remove all whitespace from a string
  10. */
  11.  
  12. #include <stdio.h>
  13. #include <ctype.h>
  14.  
  15. char *rmallws(char *str)
  16. {
  17.       char *obuf = str, *nbuf = str;
  18.  
  19.       while (*obuf)
  20.       {
  21.             if (!isspace(*obuf))
  22.                   *nbuf++ = *obuf;
  23.             ++obuf;
  24.       }
  25.       *nbuf = NUL;
  26.       return str;
  27. }
  28.